package controller.UserTable;

import entity.MsgResult;
import entity.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.SelectUserBySelectiveService;

import java.util.HashMap;
import java.util.List;

@Controller
public class SelectUserBySelectiveController {

    @Autowired
    private SelectUserBySelectiveService selectUserBySelectiveService;

    @RequestMapping("/selectUserBySelective")
    @ResponseBody
    public MsgResult selectUserBySelective(user user){
        MsgResult msgResult = new MsgResult();
        List<entity.user> users = selectUserBySelectiveService.selectUserBySelective(user);
        HashMap<String, Object> map = new HashMap<>();
        map.put("users",users);
        msgResult.setFlag(1);
        msgResult.setMsg("查询成功");
        msgResult.setData(map);
        return msgResult;
    }


}
